Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of tiny incremental simplifications of EmitterWriter internals #114104

Merged
merged 11 commits into from
Aug 4, 2023

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jul 26, 2023

ignore the first commit, it's #114088 squashed and rebased, but it's needed to use to use derive_setters, as they need a newer syn version.

Then this PR starts out with removing many arguments that are almost always defaulted to None or false and replace them with builder methods that can set these fields in the few cases that want to set them.

After that it's one commit after the other that removes or merges things until everything becomes some very simple trait objects

@rustbot
Copy link
Collaborator

rustbot commented Jul 26, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cjgillot (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 26, 2023
@oli-obk
Copy link
Contributor Author

oli-obk commented Jul 26, 2023

@bors try @rust-timer queue

@rustbot
Copy link
Collaborator

rustbot commented Jul 26, 2023

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 26, 2023
@bors
Copy link
Contributor

bors commented Jul 26, 2023

⌛ Trying commit 5ed0cf925e437829841b717a81003c575b71abf5 with merge c8cce792da6673438ebe7948ab456ff3b5f87bf9...

@oli-obk
Copy link
Contributor Author

oli-obk commented Jul 26, 2023

r? @compiler-errors because they volunteered

@rustbot rustbot assigned compiler-errors and unassigned cjgillot Jul 26, 2023
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jul 26, 2023

☀️ Try build successful - checks-actions
Build commit: c8cce792da6673438ebe7948ab456ff3b5f87bf9 (c8cce792da6673438ebe7948ab456ff3b5f87bf9)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c8cce792da6673438ebe7948ab456ff3b5f87bf9): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.4% [-3.4%, -3.4%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 650.146s -> 652.211s (0.32%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 27, 2023
@bors
Copy link
Contributor

bors commented Jul 30, 2023

☔ The latest upstream changes (presumably #114250) made this pull request unmergeable. Please resolve the merge conflicts.

@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Aug 4, 2023

📌 Commit 375d8f1 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 4, 2023
@bors
Copy link
Contributor

bors commented Aug 4, 2023

⌛ Testing commit 375d8f1 with merge fe896ef...

@bors
Copy link
Contributor

bors commented Aug 4, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing fe896ef to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 4, 2023
@bors bors merged commit fe896ef into rust-lang:master Aug 4, 2023
@rustbot rustbot added this to the 1.73.0 milestone Aug 4, 2023
@bors bors mentioned this pull request Aug 4, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fe896ef): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.5% [0.5%, 0.5%] 1
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [0.5%, 0.5%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.7% [1.2%, 4.2%] 2
Improvements ✅
(primary)
-2.9% [-3.0%, -2.8%] 2
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) -2.9% [-3.0%, -2.8%] 2

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 649.27s -> 650.185s (0.14%)

flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 11, 2023
Lots of tiny incremental simplifications of `EmitterWriter` internals

ignore the first commit, it's rust-lang#114088 squashed and rebased, but it's needed to use to use `derive_setters`, as they need a newer `syn` version.

Then this PR starts out with removing many arguments that are almost always defaulted to `None` or `false` and replace them with builder methods that can set these fields in the few cases that want to set them.

After that it's one commit after the other that removes or merges things until everything becomes some very simple trait objects
LegNeato added a commit to LegNeato/rust that referenced this pull request Aug 30, 2023
After rust-lang#114104, `rust-gpu` is unable to create a custom `Emitter` as the bounds have changed to include `WriteColor`.

I was able to work around this by adding `termcolor` as a direct dependency, but I believe this should be exposed as part of `rustc_errors` proper.

See rust-lang#102992 for why `rust-gpu` needs to create a custom emitter.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 31, 2023
Make `termcolor` types public in `rustc_errors`

After rust-lang#114104, `rust-gpu` is unable to create a custom `Emitter` as the bounds have changed to include `WriteColor`.

I was able to work around this by adding `termcolor` as a direct dependency, but I believe this should be exposed as part of `rustc_errors` proper.

See rust-lang#102992 for why `rust-gpu` needs to create a custom emitter.
calebcartwright pushed a commit to calebcartwright/rust that referenced this pull request Oct 23, 2023
Lots of tiny incremental simplifications of `EmitterWriter` internals

ignore the first commit, it's rust-lang#114088 squashed and rebased, but it's needed to use to use `derive_setters`, as they need a newer `syn` version.

Then this PR starts out with removing many arguments that are almost always defaulted to `None` or `false` and replace them with builder methods that can set these fields in the few cases that want to set them.

After that it's one commit after the other that removes or merges things until everything becomes some very simple trait objects
calebcartwright pushed a commit to calebcartwright/rust that referenced this pull request Jun 22, 2024
Lots of tiny incremental simplifications of `EmitterWriter` internals

ignore the first commit, it's rust-lang#114088 squashed and rebased, but it's needed to use to use `derive_setters`, as they need a newer `syn` version.

Then this PR starts out with removing many arguments that are almost always defaulted to `None` or `false` and replace them with builder methods that can set these fields in the few cases that want to set them.

After that it's one commit after the other that removes or merges things until everything becomes some very simple trait objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants